﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Planer.Model;

namespace Planer.UI.Controls
{
    public partial class BillPresentButton : Button
    {

        billing bill = null;
        const int buttonHeight = 50;

        private static Color Green = Color.FromArgb(150, 179, 227, 180);
        private static Color Red = Color.FromArgb(150, 250, 169, 160);

        public billing Bill
        {
            get { return bill; }
            set 
            {
                if (value == null) return;
                bill = value;

                this.Text = bill.ToString();
                if (bill.balance > 0)
                {
                    this.BackColor = Green;
                }
                else
                {
                    this.BackColor = Red;
                }
            }
        }

        public BillPresentButton()
        {
            InitializeComponent();
            //this.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
            Height = buttonHeight;
            Font = new Font(new FontFamily("Consolas"), 9.5f);
            this.AutoSize = true;
            this.Height = 50;
        }
      
    }
}
